
*use Excel dataset

log using StataResults

import excel "C:\Users\efren\Dropbox\PC\Documents\Desktop\Majority-Minority Project\Wave 1 data\UMAS0083_OUTPUT_0724.xlsx", sheet("UMAS0083_OUTPUT_0724") firstrow

*code race

encode race_pipe,gen(race1)
tab race1
tab race1, nolabel

gen poc=0
recode poc(0=1) if race1==1
recode poc(0=1) if race1==2
recode poc(0=1) if race1==3
recode poc(0=1) if race1==5

tab poc

*code solidarity items

encode Q31_1, gen(solidarity1)
encode Q31_2, gen(pocproblems1)
encode Q31_3, gen(poclinked1)


tab solidarity1, nolabel
tab pocproblems1, nolabel
tab poclinked1, nolabel

recode solidarity1 (1=3)(2=4)(3=2)(4=5)(5=1)
summ solidarity1

recode pocproblems1 (1=3)(2=4)(3=2)(4=5)(5=1)(6=.)
summ pocproblems1

recode poclinked1 (1=3)(2=4)(3=2)(4=5)(5=1)(6=.)
summ poclinked1

summ solidarity1 pocproblems1 poclinked1 if poc==1
alpha solidarity1 pocproblems1 poclinked1 if poc==1, std

gen solidscale1=(solidarity1+pocproblems1+poclinked1)/3
gen solidscale=(solidscale1-1)/4
summ solidscale if poc==1

*asians
alpha solidarity1 pocproblems1 poclinked1 if race1==1, std
*blacks
alpha solidarity1 pocproblems1 poclinked1 if race1==2, std
*latinos
alpha solidarity1 pocproblems1 poclinked1 if race1==3, std
*mixed
alpha solidarity1 pocproblems1 poclinked1 if race1==5, std

*asians
summ solidscale if race1==1
*blacks
summ solidscale if race1==2
*latinos
summ solidscale if race1==3
*mixed
summ solidscale if race1==5


*code PoC ID items

encode Q30_1, gen(pocimportant1)
encode Q30_2, gen(pocmyself1)
encode Q30_3, gen(pocthink1)

recode pocimportant1 (1=3)(2=4)(3=2)(4=5)(5=1)(6=.)
recode pocmyself1 (1=3)(2=4)(3=2)(4=5)(5=1)(6=.)
recode pocthink1 (1=3)(2=4)(3=2)(4=5)(5=1)(6=.)(7=.)

summ pocimportant1 pocmyself pocthink1 if poc==1

*asians
alpha pocimportant1 pocmyself pocthink1 if race1==1, std
*blacks
alpha pocimportant1 pocmyself pocthink1 if race1==2, std
*latinos
alpha pocimportant1 pocmyself pocthink1 if race1==3, std
*mixed
alpha pocimportant1 pocmyself pocthink1 if race1==5, std

gen pocidscale1=(pocimportant1+pocmyself1+pocthink1)/3
gen pocidscale=(pocidscale1-1)/4
summ pocidscale if poc==1


*code racial identity

encode Q28_1, gen(rimportant1)
encode Q28_2, gen(rmyself1)
encode Q28_3, gen(rthink1)

recode rimportant1 (1=3)(2=4)(3=2)(4=5)(5=1)(6=.)(7=.)
recode rmyself1 (1=3)(2=4)(3=2)(4=5)(5=1)(6=.)(7=.)
recode rthink1 (1=3)(2=4)(3=2)(4=5)(5=1)(6=.)(7=.)

*asians
summ rimportant1 rmyself rthink1 if race1==1
*blacks
summ rimportant1 rmyself rthink if race1==2
*latinos
summ rimportant1 rmyself rthink if race1==3
*mixed - not asked


*asians
alpha rimportant1 rmyself rthink1 if race1==1, std
*blacks
alpha rimportant1 rmyself rthink if race1==2, std
*latinos
alpha rimportant1 rmyself rthink if race1==3, std
*mixed - not asked

gen raceID1=(rimportant1+rmyself+rthink1)/3
gen raceID=(raceID1-1)/4
summ raceID


*asians
pwcorr pocidscale raceID if race1==1, sig
*blacks
pwcorr pocidscale raceID if race1==2, sig
*latinos
pwcorr pocidscale raceID if race1==3, sig
*mixed - not asked



*code ideology
encode ideo5, gen (liberal1) 
recode liberal1(1=2)(2=4)(3=3)(4=3)(5=1)(6=5)
summ liberal1

*ideology, with unsure dropped

encode ideo5, gen (liberal2) 
recode liberal2(1=2)(2=4)(3=3)(4=.)(5=1)(6=5)
summ liberal2

summ liberal1 liberal2 if poc==1

gen liberal=(liberal1-1)/4
summ liberal

pwcorr solidscale liberal if poc==1, sig

*code partisanship

encode pid7, gen(democrat1)
recode democrat1 (1=4)(2=5)(3=3)(4=4)(5=6)(6=2)(7=7)(8=1)
summ democrat1 if poc==1

encode pid7, gen(democrat2)
recode democrat2 (1=4)(2=5)(3=3)(4=.)(5=6)(6=2)(7=7)(8=1)
summ democrat2

summ democrat1 democrat2 if poc==1

gen democrat=(democrat1-1)/6
summ democrat

*asians
reg solidscale pocidscale raceID liberal democrat if race1==1
*blacks
reg solidscale pocidscale raceID liberal democrat if race1==2
*latinos
reg solidscale pocidscale raceID liberal democrat if race1==3
*mixed
reg solidscale pocidscale liberal democrat if race1==5

***drop white people
drop if race1==4

gen asian=0
recode asian(0=1) if race1==1

gen latino=0
recode latino(0=1) if race1==3

gen multi=0
recode multi(0=1) if race1==5

tab asian
tab latino
tab multi

/*Table 2. Polychoric Correlation Matrix*/

polychoric pocimportant1 pocmyself pocthink1 solidarity1 pocproblems1 poclinked1


/*descriptive analyses*/

summ solidscale pocidscale

reg pocidscale asian latino multi

reg solidscale asian latino multi


/*code DACA*/

encode Q14a_1, gen(daca1)
tab daca1
tab daca1, nolabel

recode daca1(1=3)(2=4)(3=2)(4=5)(5=1)(6=.)(7=.)
summ daca1

gen daca=(daca1-1)/4
summ daca

/*code H1-B*/

encode Q14a_2, gen(H1B1)
tab H1B1
tab H1B1, nolabel

recode H1B1(1=3)(2=4)(3=2)(4=5)(5=1)(6=.)(7=.)
summ H1B1

gen H1B=(H1B1-1)/4
summ H1B
rename H1B h1b

/*code reparations*/

encode Q14a_4, gen(reparate1)
tab reparate1
tab reparate1, nolabel

recode reparate1(1=3)(2=4)(3=2)(4=5)(5=1)(6=.)(7=.)
summ reparate1

gen reparate=(reparate1-1)/4
summ reparate

/*Figure 1. Mean Levels of PoC ID and PoC Solidarity*/

reg pocidscale asian latino multi
reg solidscale asian latino multi


/*regressions with solidarity as mediator*/

reg daca pocidscale liberal asian latino multi
reg daca solidscale pocidscale liberal asian latino multi

reg h1b pocidscale liberal asian latino multi
reg h1b solidscale pocidscale liberal asian latino multi

reg reparate pocidscale liberal asian latino multi
reg reparate solidscale pocidscale liberal asian latino multi

/*Figure 3. Solidarity Mediates the Influence of PoC Identification on Support for Policies*/

/*Table 5. Sensitivity Analyses by Racial Group*/ 

/*Mediation analyses with full set of policy outcomes*/ 

/*regressions with solidarity as mediator, group-by-group*/

*blacks

reg daca pocidscale liberal if race1==2
reg solidscale pocidscale liberal if race1==2
reg daca solidscale pocidscale liberal if race1==2

reg h1b pocidscale liberal if race1==2
reg solidscale pocidscale liberal if race1==2
reg h1b solidscale pocidscale liberal if race1==2

reg reparate pocidscale liberal if race1==2
reg solidscale pocidscale liberal if race1==2
reg reparate solidscale pocidscale liberal if race1==2

*asians

reg daca pocidscale liberal if asian==1
reg solidscale pocidscale liberal if asian==1
reg daca solidscale pocidscale liberal if asian==1

reg h1b pocidscale liberal if asian==1
reg solidscale pocidscale liberal if asian==1
reg h1b solidscale pocidscale liberal if asian==1

reg reparate pocidscale liberal if asian==1
reg solidscale pocidscale liberal if asian==1
reg reparate solidscale pocidscale liberal if asian==1


*latinos

reg daca pocidscale liberal if latino==1
reg solidscale pocidscale liberal if latino==1
reg daca solidscale pocidscale liberal if latino==1

reg h1b pocidscale liberal if latino==1
reg solidscale pocidscale liberal if latino==1
reg h1b solidscale pocidscale liberal if latino==1

reg reparate pocidscale liberal if latino==1
reg solidscale pocidscale liberal if latino==1
reg reparate solidscale pocidscale liberal if latino==1

*multiracials

reg daca pocidscale liberal if multi==1
reg solidscale pocidscale liberal if multi==1
reg daca solidscale pocidscale liberal if multi==1

reg h1b pocidscale liberal if multi==1
reg solidscale pocidscale liberal if multi==1
reg h1b solidscale pocidscale liberal if multi==1

reg reparate pocidscale liberal if multi==1
reg solidscale pocidscale liberal if multi==1
reg reparate solidscale pocidscale liberal if multi==1


/*regressions predicting unique variance*/

*blacks

reg daca pocidscale if race1==2
reg daca solidscale if race1==2
reg daca pocidscale liberal if race1==2

reg h1b pocidscale if race1==2
reg h1b solidscale if race1==2
reg h1b solidscale pocidscale if race1==2

reg reparate pocidscale if race1==2
reg reparate solidscale if race1==2
reg reparate solidscale pocidscale if race1==2


*latinos

reg daca pocidscale if latino==1
reg daca solidscale if latino==1
reg daca solidscale pocidscale if latino==1

reg h1b pocidscale if latino==1
reg h1b solidscale if latino==1
reg h1b solidscale pocidscale if latino==1

reg reparate pocidscale if latino==1
reg reparate solidscale if latino==1
reg reparate solidscale pocidscale if latino==1


*aians

reg daca pocidscale if asian==1
reg daca solidscale if asian==1
reg daca solidscale pocidscale if asian==1

reg h1b pocidscale if asian==1
reg h1b solidscale if asian==1
reg h1b solidscale pocidscale if asian==1

reg reparate pocidscale if asian==1
reg reparate solidscale if asian==1
reg reparate solidscale pocidscale if asian==1


*multiracials

reg daca pocidscale if multi==1
reg daca solidscale if multi==1
reg daca solidscale pocidscale if multi==1

reg h1b pocidscale if multi==1
reg h1b solidscale if multi==1
reg h1b solidscale pocidscale if multi==1

reg reparate pocidscale if multi==1
reg reparate solidscale if multi==1
reg reparate solidscale pocidscale if multi==1

log close

translate StataResults.smcl StataResults.pdf



